//
//  HomeViewModel.swift
//  ZJProject
//
//  Created by HyBoard on 2019/7/12.
//  Copyright © 2019 HyBoard. All rights reserved.
//

import UIKit
import RxSwift

class HomeViewModel: NSObject {
    
    let disposeBag = DisposeBag()
}

extension HomeViewModel {
    
    func getNewsList() {
        
        NetRequest.instance.netRequest(api: .news).mapHandyJsonModel(HomeBaseModel.self).subscribe({ [unowned self] (event) in
            
            switch event {
            case let  .next(classModel):
                
                print("HandyJSON -- 加载网络成功")
                
            case let .error( error):
                print("error:", error)
            case .completed:
                print("completed")
                break
            }
        }).disposed(by: self.disposeBag)
    }
}
